
package com.shop.cereshop.app.dao.wallet;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.commons.domain.wallet.PayPasswordLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 支付密码日志DAO接口
 * @author wang.yao
 * @date 2025-08-26
 */
@Mapper
public interface PayPasswordLogDAO extends BaseMapper<PayPasswordLog> {

    /**
     * 根据用户ID查询支付密码日志
     * @param buyerUserId 用户ID
     * @param limit 限制条数
     * @return 日志列表
     */
    List<PayPasswordLog> selectByUserId(@Param("buyerUserId") Long buyerUserId, @Param("limit") Integer limit);

    /**
     * 统计用户今日验证失败次数
     * @param buyerUserId 用户ID
     * @param operationType 操作类型
     * @return 失败次数
     */
    int countTodayFailedAttempts(@Param("buyerUserId") Long buyerUserId, @Param("operationType") Integer operationType);
}
